<?php
//头部导入
	include ('header.php');
	//页面字符
	header('content-type:text/html;charset=utf8');
	//header('content-type:application/json;charset=utf8');
	
//打开session
	if(!isset($_SESSION)){
    session_start();
	}
	$agent = check_wap();
	if($agent){
	
	}else{
	//左边菜单栏	
		echo <<<END
        <div class="container-fluid">
      <div class="row-fluid">
        <div class="span2">
          <div class="well sidebar-nav">
            <ul class="nav nav-list">
END;
		if($level !=3){
			echo "<li class='nav-header'>车辆管理</li>";
			echo "<li><a href='xiugaizt.php'>车辆状态</a></li>";
			echo "<li><a href='sqyc.php'>用车申请</a></li>";
			echo "<li><a href='address.php'>通讯录</a></li>";
		}
                                                           			  
		if($level != 0 and $level !=3){
			echo "<li><a href='a02state.php'>状态记录</a></li>";
			echo "<li><a href='a05.php'>用车说明</a></li>";
		}
		
		if($level!=-2 and $level !=-1){
				echo "<li><a href='updatepassword.php'>用户修改密码</a></li>";			  
			}
		if($level==-2 or $level==-1){
				echo "<li><a href='xiugaimima.php'>修改密码</a></li>";			  
			}
			
			if($level==-2 or $level==-1){
				echo "<li><a href='xiugaijibie.php'>修改用户级别</a></li>";
				echo "<li><a href='guanliyonghu.php'>用户申请管理</a></li>";		
			}
			

			if($level !=0 and $level !=1 and $level !=3){
				echo "<li><a href='daochuyongche.php'>导出用车</a></li>";
							
			}
			if($level==3){
				echo "<li><a href='fufei.php'>用户付费</a></li>";			  
			}
			if($level !=0 and $level !=1 and $level != 11 and $level != 3){
				echo "<li><a href='adche.php'>添加车辆</a></li>";
				echo "<li><a href='updatejiashiyuan.php'>修改驾驶员</a></li>";
				echo "<li><a href='yingchang.php'>删除车辆</a></li>";
				echo "<li><a href='tianjiazhuangtai.php'>添加状态</a></li>";
			}
			if($level==-2 or $level==-1){
				echo "<li><a href='gonggao.php'>公司公告</a></li>";
				echo "<li><a href='plyonghu.php'>批量添加用户</a></li>";	
				echo "<li><a href='pltjzhuangtai.php'>批量添加车辆状态</a></li>";					
			}
			
			if($level==9)
			{
			echo "<li><a href='paimai.php'>拍卖页面</a></li>";
			echo "<li><a href='adjingpai.php'>竞拍页面</a></li>";
			echo "<li><a href='daichengjiao.php'>待成交页面</a></li>";
			echo "<li><a href='chenjiao.php'>成交页面</a></li>";
			echo "<li><a href='deletepaimai.php'>删除拍卖信息</a></li>";
			}
			
	echo <<<end9
	
			  <li><a href="logout.php">退出</a></li>
            </ul>
          </div><!--/.well -->
        </div><!--/span-->
        <div class="span10">		
	
end9;
}
	$uid = $_SESSION['uid'];
	$cid = $_SESSION["cid"];
	$uname=$_SESSION['user'];
	
//同意时接收值	
	if (isset($_GET['account'])) 
	{
		$shenqingren=$_GET['account'];
		$updatesqla1="update a00user set jihuo=\"1\" where uname=\"$shenqingren\"";
		mysql_query($updatesqla1);
		$querysqla1="select uname from a00user where jihuo=\"1\" and uname=\"$shenqingren\"";
		$querysqla2=mysql_query($querysqla1);
		$querysqla3=mysql_num_rows($querysqla2);
		if($querysqla3<1)
		{
			echo "<script>"."alert('操作失败')"."</script>";
		}
		else
		{
			redirect('guanliyonghu.php');
		}
			
	}
//不同意时接收值		
	if (isset($_GET['account1']))
	{
		$account1=$_GET['account1'];
		$deletesql="delete from a00user where uname=\"$account1\"";
		mysql_query($deletesql);
		
		$querysqlb1="select uname from a00user where uname=\"$shenqingren\"";
		$querysqlb2=mysql_query($querysqlb1);
		$querysqlb3=mysql_num_rows($querysqlb2);
		if($querysqlb3>0)
		{
			echo "<script>alert('操作失败')</script>";
		}
		else
		{
			redirect('guanliyonghu.php');
		}
	}
//显示的表格	
	$sqla1="select uname,movephoto from a00user where jihuo=\"0\" and c_id=\"$cid\"";
	$sqla2=mysql_query($sqla1);
		
	echo <<<enda1
	<div class="well">
	<table class="table">
	<tr>
	<th>申请人</th>
	<th>电话</th>
	<th>操作</th>
	</tr>
enda1;
	while($sqla3=mysql_fetch_row($sqla2))
	{
		echo "<tr>";
		echo "<td>$sqla3[0]</td>";
		echo "<td>$sqla3[1]</td>";
		echo "<td><a href='guanliyonghu.php?account=$sqla3[0]'>同意</a>/<a href='guanliyonghu.php?account1=$sqla3[0]'>不同意</a></td>";
		echo "</tr>";
	}
	
	echo "</table></div>";
	
	
include 'bottom.php';	
?>	